package com.kzy.demoadmin.web.mapper;

import com.github.pagehelper.PageInfo;
import com.kzy.demoadmin.web.entity.BookType;
import com.kzy.demoadmin.web.entity.BookTypeQuery;
import org.apache.ibatis.annotations.*;
import java.util.List;

/**
 * 图书分类数据访问接口
 */
public interface BookTypeMapper {

    // 新增分类
    int insert(BookType bookType);

    // 根据ID删除分类
    @Delete("DELETE FROM book_type WHERE id = #{id}")
    int deleteById(Integer id);

    // 更新分类
    int update(BookType bookType);

    // 根据ID查询分类
    @Select("SELECT id, name, description FROM book_type WHERE id = #{id}")
    BookType selectById(Integer id);

    // 查询所有分类
    List<BookType> selectAll(BookTypeQuery query);
}